<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>index</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<h1>登陆页面</h1>
<p>你的当前用户名是：</p>
<p th:text="${username}" style="margin-top: 25px; color: crimson">wxb</p>
<p>你的权限是：</p>
<p th:text="${authorities}" style="margin-top: 25px; color: crimson">authorities</p>
<form th:action="@{/logout}" method="post">
    <button class="btn btn-danger" style="margin-top: 20px">退出登录</button>
</form>
<div style="text-align: center;margin:0 auto;width: 1000px; ">
    <form th:action="@{/login}" method="post">
        <!-- 1.自定义参数名：myusername和mypassword-->
        <div>
            用户名： <input type="text" name="myusername"/>
        </div>
        <div>
            密码： <input type="password" name="mypassword"/>
        </div>
        <div th:if="${param.error}">
            <p style="text-align: center" class="text-danger">登录失败，账号或密码错误!</p>
        </div>
        <div th:if="${result}">
            <p style="text-align: center" class="text-success" th:text="${result}"></p>
        </div>
        <div>
            <input type="submit" value="登陆"/>
        </div>
    </form>
    <a href="/index">主页</a>
    <a href="/user">用户页面</a>
    <a href="/depart1">部门1页面</a>
    <a href="/depart2">部门2页面</a>
    <a href="/admin">管理员页面</a>
    <a href="/login">登录页面</a>
</div>
</body>
</html>